package com.restkeeper.vo.store;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 挂账导出数据对象
 */
@Data
@ExcelIgnoreUnannotated // 生产excel时忽略未注释的字段
@ContentRowHeight(15)// 内容行高
@HeadRowHeight(20)// 头高度
@ColumnWidth(25)// 列宽
public class CreditExportVO {

    /**
     * 订单
     */
    @ColumnWidth(30)
    @ExcelProperty(value = "订单号",index = 0) // value表示列名称，index表示第几列（列下标）
    private String orderId;

    /**
     * 挂账人名称
     */
    @ExcelProperty(value = "挂账人", index = 1)
    private String userName;

    /**
     * 挂账类型 挂账类型  1 公司 2 个人
     */
    @ExcelProperty(value = "挂账类型", index = 2)
    private String creditType;

    /**
     * 挂账公司名称
     */
    @ExcelProperty(value = "挂账公司", index = 3)
    private String companyName;

    /**
     * 订单金额
     */
    @ExcelProperty(value = "订单金额", index = 4)
    private Integer orderAmount;

    /**
     * 应收金额
     */
    @ExcelProperty(value = "应收金额", index = 5)
    private Integer receivedAmount;

    /**
     * 挂账金额
     */
    @ExcelProperty(value = "挂账金额", index = 6)
    private Integer creditAmount;

    /**
     * 最后更新时间
     */
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")// 日期格式化
    @ExcelProperty(value = "挂账时间", index = 7)
    private LocalDateTime lastUpdateTime;
}